<template>
		<view class="">
			<view :style="{'height': systemInfo.navigationCustomCapsuleHeight+'px;margin-top:' + systemInfo.navigationCustomStatusHeight + 'px'}"></view>
			<view class="back-icon" :style="{'--height--': systemInfo.navigationCustomCapsuleHeight+'px;top:' + systemInfo.navigationCustomStatusHeight + 'px'}">
				<text @click="back" :class="'iconfont ' + (share ? 'icon-home' : 'icon-fanhui')" :style="{'color':color}"></text>
			</view>
		</view>
</template>

<script>
	export default {
		props: {
			share: {
				type: Boolean,
				default: () => false
			},
			color:{
				type:String,
				default:''
			}
		},
		data() {
			return {
				
			};
		},
		computed: {
			systemInfo() {
				return this.$store.state.system
			}
		},
		methods: {
			back() {
				if(this.share) {
					uni.switchTab({
						url: '/pages/index/index'
					})
				} else {
					uni.navigateBack()
				}
			}
		}
	}
</script>

<style scoped>
	.back-icon {
		position: fixed;
		width: 100%;
		height: var(--height--);
		line-height: var(--height--);
		z-index: 99;
	}
	.back-icon .iconfont {
		padding: 10rpx 32rpx;
		font-size: 40rpx;
	}
</style>